<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 1. 准备容器 -->
    <div id="root"></div>

    <!-- 2. 引入js依赖 -->
    <!-- 2-1. 引入react核心库 -->
    <script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
    <!-- 2-2. 引入react-dom，用于支持react操作DOM -->
    <script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
    <!-- 2-3. 引入babel，用于将jsx转为js -->
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>

    <!-- 3. type一定要写babel -->
    <script type="text/babel">
        // 4. 创建虚拟DOM，此处一定不要写引号
        const VDOM = (
            <h1 id="title">
                <span>Hello, React</span>
            </h1>
        )

        // 5. 渲染虚拟DOM到页面
        ReactDOM.render(VDOM, document.getElementById('root'))
    </script>
</body>
</html>